3 * Utility class for creating and accessing recent change entries.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
24 * Utility class for creating new RC entries
27 * rc_id id of the row in the recentchanges table
28 * rc_timestamp time the entry was made
29 * rc_namespace namespace #
30 * rc_title non-prefixed db key
31 * rc_type is new entry, used to determine whether updating is necessary
32 * rc_source string representation of change source
34 * rc_cur_id page_id of associated page entry
35 * rc_user user id who made the entry
36 * rc_user_text user name who made the entry
37 * rc_comment edit summary
38 * rc_this_oldid rev_id associated with this entry (or zero)
39 * rc_last_oldid rev_id associated with the entry before this one (or zero)
40 * rc_bot is bot, hidden
41 * rc_ip IP address of the user in dotted quad notation
42 * rc_new obsolete, use rc_type==RC_NEW
43 * rc_patrolled boolean whether or not someone has marked this edit as patrolled
44 * rc_old_len integer byte length of the text before the edit
45 * rc_new_len the same after the edit
46 * rc_deleted partial deletion
47 * rc_logid the log_id value for this log entry (or zero)
48 * rc_log_type the log type (or null)
49 * rc_log_action the log action (or null)
50 * rc_params log params
53 * prefixedDBkey prefixed db key, used by external app via msg queue
54 * lastTimestamp timestamp of previous entry, used in WHERE clause during update
55 * oldSize text size before the change
56 * newSize text size after the change
57 * pageStatus status of the page: created, deleted, moved, restored, changed
59 * temporary: not stored in the database
60 * notificationtimestamp
61 * numberofWatchingusers
64 // Constants for the rc_source field. Extensions may also have
65 // their own source constants.
66 const SRC_EDIT
= 'mw.edit';
67 const SRC_NEW
= 'mw.new';
68 const SRC_LOG
= 'mw.log';
69 const SRC_EXTERNAL
= 'mw.external'; // obsolete
70 const SRC_CATEGORIZE
= 'mw.categorize';
72 public $mAttribs = array();
73 public $mExtra = array();
78 public $mTitle = false;
83 private $mPerformer = false;
85 public $numberofWatchingusers = 0; # Dummy to prevent error message in SpecialRecentChangesLinked
86 public $notificationtimestamp;
89 * @var int Line number of recent change. Default -1.
94 * @var array Array of change types
96 private static $changeTypes = array(
100 'external' => RC_EXTERNAL
,
101 'categorize' => RC_CATEGORIZE
,
108 * @return RecentChange
110 public static function newFromRow( $row ) {
111 $rc = new RecentChange
;
112 $rc->loadFromRow( $row );
118 * Parsing text to RC_* constants
120 * @param string|array $type
121 * @throws MWException
122 * @return int|array RC_TYPE
124 public static function parseToRCType( $type ) {
125 if ( is_array( $type ) ) {
127 foreach ( $type as $t ) {
128 $retval[] = RecentChange
::parseToRCType( $t );
134 if ( !array_key_exists( $type, self
::$changeTypes ) ) {
135 throw new MWException( "Unknown type '$type'" );
137 return self
::$changeTypes[$type];
141 * Parsing RC_* constants to human-readable test
144 * @return string $type
146 public static function parseFromRCType( $rcType ) {
147 return array_search( $rcType, self
::$changeTypes, true ) ?
: "$rcType";
151 * Get an array of all change types
157 public static function getChangeTypes() {
158 return array_keys( self
::$changeTypes );
162 * Obtain the recent change with a given rc_id value
164 * @param int $rcid The rc_id value to retrieve
165 * @return RecentChange|null
167 public static function newFromId( $rcid ) {
168 return self
::newFromConds( array( 'rc_id' => $rcid ), __METHOD__
);
172 * Find the first recent change matching some specific conditions
174 * @param array $conds Array of conditions
175 * @param mixed $fname Override the method name in profiling/logs
176 * @return RecentChange|null
178 public static function newFromConds( $conds, $fname = __METHOD__
) {
179 $dbr = wfGetDB( DB_SLAVE
);
180 $row = $dbr->selectRow( 'recentchanges', self
::selectFields(), $conds, $fname );
181 if ( $row !== false ) {
182 return self
::newFromRow( $row );
189 * Return the list of recentchanges fields that should be selected to create
190 * a new recentchanges object.
193 public static function selectFields() {
225 * @param array $attribs
227 public function setAttribs( $attribs ) {
228 $this->mAttribs
= $attribs;
232 * @param array $extra
234 public function setExtra( $extra ) {
235 $this->mExtra
= $extra;
241 public function &getTitle() {
242 if ( $this->mTitle
=== false ) {
243 $this->mTitle
= Title
::makeTitle( $this->mAttribs
['rc_namespace'], $this->mAttribs
['rc_title'] );
246 return $this->mTitle
;
250 * Get the User object of the person who performed this change.
254 public function getPerformer() {
255 if ( $this->mPerformer
=== false ) {
256 if ( $this->mAttribs
['rc_user'] ) {
257 $this->mPerformer
= User
::newFromId( $this->mAttribs
['rc_user'] );
259 $this->mPerformer
= User
::newFromName( $this->mAttribs
['rc_user_text'], false );
263 return $this->mPerformer
;
267 * Writes the data in this object to the database
270 public function save( $noudp = false ) {
271 global $wgPutIPinRC, $wgUseEnotif, $wgShowUpdatedMarker, $wgContLang;
273 $dbw = wfGetDB( DB_MASTER
);
274 if ( !is_array( $this->mExtra
) ) {
275 $this->mExtra
= array();
278 if ( !$wgPutIPinRC ) {
279 $this->mAttribs
['rc_ip'] = '';
282 # If our database is strict about IP addresses, use NULL instead of an empty string
283 if ( $dbw->strictIPs() && $this->mAttribs
['rc_ip'] == '' ) {
284 unset( $this->mAttribs
['rc_ip'] );
287 # Trim spaces on user supplied text
288 $this->mAttribs
['rc_comment'] = trim( $this->mAttribs
['rc_comment'] );
290 # Make sure summary is truncated (whole multibyte characters)
291 $this->mAttribs
['rc_comment'] = $wgContLang->truncate( $this->mAttribs
['rc_comment'], 255 );
293 # Fixup database timestamps
294 $this->mAttribs
['rc_timestamp'] = $dbw->timestamp( $this->mAttribs
['rc_timestamp'] );
295 $this->mAttribs
['rc_id'] = $dbw->nextSequenceValue( 'recentchanges_rc_id_seq' );
297 # # If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL
298 if ( $dbw->cascadingDeletes() && $this->mAttribs
['rc_cur_id'] == 0 ) {
299 unset( $this->mAttribs
['rc_cur_id'] );
303 $dbw->insert( 'recentchanges', $this->mAttribs
, __METHOD__
);
306 $this->mAttribs
['rc_id'] = $dbw->insertId();
309 Hooks
::run( 'RecentChange_save', array( &$this ) );
311 # Notify external application via UDP
313 $this->notifyRCFeeds();
316 # E-mail notifications
317 if ( $wgUseEnotif ||
$wgShowUpdatedMarker ) {
318 $editor = $this->getPerformer();
319 $title = $this->getTitle();
321 if ( Hooks
::run( 'AbortEmailNotification', array( $editor, $title, $this ) ) ) {
322 # @todo FIXME: This would be better as an extension hook
323 $enotif = new EmailNotification();
324 $enotif->notifyOnPageChange( $editor, $title,
325 $this->mAttribs
['rc_timestamp'],
326 $this->mAttribs
['rc_comment'],
327 $this->mAttribs
['rc_minor'],
328 $this->mAttribs
['rc_last_oldid'],
329 $this->mExtra
['pageStatus'] );
333 // Update the cached list of active users
334 if ( $this->mAttribs
['rc_user'] > 0 ) {
335 JobQueueGroup
::singleton()->lazyPush( RecentChangesUpdateJob
::newCacheUpdateJob() );
340 * Notify all the feeds about the change.
341 * @param array $feeds Optional feeds to send to, defaults to $wgRCFeeds
343 public function notifyRCFeeds( array $feeds = null ) {
345 if ( $feeds === null ) {
349 $performer = $this->getPerformer();
351 foreach ( $feeds as $feed ) {
353 'omit_bots' => false,
354 'omit_anon' => false,
355 'omit_user' => false,
356 'omit_minor' => false,
357 'omit_patrolled' => false,
361 ( $feed['omit_bots'] && $this->mAttribs
['rc_bot'] ) ||
362 ( $feed['omit_anon'] && $performer->isAnon() ) ||
363 ( $feed['omit_user'] && !$performer->isAnon() ) ||
364 ( $feed['omit_minor'] && $this->mAttribs
['rc_minor'] ) ||
365 ( $feed['omit_patrolled'] && $this->mAttribs
['rc_patrolled'] ) ||
366 $this->mAttribs
['rc_type'] == RC_EXTERNAL
371 $engine = self
::getEngine( $feed['uri'] );
373 if ( isset( $this->mExtra
['actionCommentIRC'] ) ) {
374 $actionComment = $this->mExtra
['actionCommentIRC'];
376 $actionComment = null;
379 /** @var $formatter RCFeedFormatter */
380 $formatter = is_object( $feed['formatter'] ) ?
$feed['formatter'] : new $feed['formatter']();
381 $line = $formatter->getLine( $feed, $this, $actionComment );
384 // If a feed formatter returns null, this will otherwise cause an
385 // error in at least RedisPubSubFeedEngine.
386 // Not sure where/how this should best be handled.
390 $engine->send( $feed, $line );
395 * Gets the stream engine object for a given URI from $wgRCEngines
397 * @param string $uri URI to get the engine object for
398 * @throws MWException
399 * @return RCFeedEngine The engine object
401 public static function getEngine( $uri ) {
404 $scheme = parse_url( $uri, PHP_URL_SCHEME
);
406 throw new MWException( __FUNCTION__
. ": Invalid stream logger URI: '$uri'" );
409 if ( !isset( $wgRCEngines[$scheme] ) ) {
410 throw new MWException( __FUNCTION__
. ": Unknown stream logger URI scheme: $scheme" );
413 return new $wgRCEngines[$scheme];
417 * Mark a given change as patrolled
419 * @param RecentChange|int $change RecentChange or corresponding rc_id
420 * @param bool $auto For automatic patrol
421 * @return array See doMarkPatrolled(), or null if $change is not an existing rc_id
423 public static function markPatrolled( $change, $auto = false ) {
426 $change = $change instanceof RecentChange
428 : RecentChange
::newFromId( $change );
430 if ( !$change instanceof RecentChange
) {
434 return $change->doMarkPatrolled( $wgUser, $auto );
438 * Mark this RecentChange as patrolled
440 * NOTE: Can also return 'rcpatroldisabled', 'hookaborted' and
441 * 'markedaspatrollederror-noautopatrol' as errors
442 * @param User $user User object doing the action
443 * @param bool $auto For automatic patrol
444 * @return array Array of permissions errors, see Title::getUserPermissionsErrors()
446 public function doMarkPatrolled( User
$user, $auto = false ) {
447 global $wgUseRCPatrol, $wgUseNPPatrol;
449 // If recentchanges patrol is disabled, only new pages
451 if ( !$wgUseRCPatrol && ( !$wgUseNPPatrol ||
$this->getAttribute( 'rc_type' ) != RC_NEW
) ) {
452 $errors[] = array( 'rcpatroldisabled' );
454 // Automatic patrol needs "autopatrol", ordinary patrol needs "patrol"
455 $right = $auto ?
'autopatrol' : 'patrol';
456 $errors = array_merge( $errors, $this->getTitle()->getUserPermissionsErrors( $right, $user ) );
457 if ( !Hooks
::run( 'MarkPatrolled', array( $this->getAttribute( 'rc_id' ), &$user, false ) ) ) {
458 $errors[] = array( 'hookaborted' );
460 // Users without the 'autopatrol' right can't patrol their
462 if ( $user->getName() === $this->getAttribute( 'rc_user_text' )
463 && !$user->isAllowed( 'autopatrol' )
465 $errors[] = array( 'markedaspatrollederror-noautopatrol' );
470 // If the change was patrolled already, do nothing
471 if ( $this->getAttribute( 'rc_patrolled' ) ) {
474 // Actually set the 'patrolled' flag in RC
475 $this->reallyMarkPatrolled();
476 // Log this patrol event
477 PatrolLog
::record( $this, $auto, $user );
478 Hooks
::run( 'MarkPatrolledComplete', array( $this->getAttribute( 'rc_id' ), &$user, false ) );
484 * Mark this RecentChange patrolled, without error checking
485 * @return int Number of affected rows
487 public function reallyMarkPatrolled() {
488 $dbw = wfGetDB( DB_MASTER
);
495 'rc_id' => $this->getAttribute( 'rc_id' )
499 // Invalidate the page cache after the page has been patrolled
500 // to make sure that the Patrol link isn't visible any longer!
501 $this->getTitle()->invalidateCache();
503 return $dbw->affectedRows();
507 * Makes an entry in the database corresponding to an edit
509 * @param string $timestamp
510 * @param Title $title
513 * @param string $comment
515 * @param string $lastTimestamp
518 * @param int $oldSize
519 * @param int $newSize
522 * @return RecentChange
524 public static function notifyEdit(
525 $timestamp, &$title, $minor, &$user, $comment, $oldId, $lastTimestamp,
526 $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol = 0
528 $rc = new RecentChange
;
529 $rc->mTitle
= $title;
530 $rc->mPerformer
= $user;
531 $rc->mAttribs
= array(
532 'rc_timestamp' => $timestamp,
533 'rc_namespace' => $title->getNamespace(),
534 'rc_title' => $title->getDBkey(),
535 'rc_type' => RC_EDIT
,
536 'rc_source' => self
::SRC_EDIT
,
537 'rc_minor' => $minor ?
1 : 0,
538 'rc_cur_id' => $title->getArticleID(),
539 'rc_user' => $user->getId(),
540 'rc_user_text' => $user->getName(),
541 'rc_comment' => $comment,
542 'rc_this_oldid' => $newId,
543 'rc_last_oldid' => $oldId,
544 'rc_bot' => $bot ?
1 : 0,
545 'rc_ip' => self
::checkIPAddress( $ip ),
546 'rc_patrolled' => intval( $patrol ),
547 'rc_new' => 0, # obsolete
548 'rc_old_len' => $oldSize,
549 'rc_new_len' => $newSize,
552 'rc_log_type' => null,
553 'rc_log_action' => '',
558 'prefixedDBkey' => $title->getPrefixedDBkey(),
559 'lastTimestamp' => $lastTimestamp,
560 'oldSize' => $oldSize,
561 'newSize' => $newSize,
562 'pageStatus' => 'changed'
565 DeferredUpdates
::addCallableUpdate( function() use ( $rc ) {
567 if ( $rc->mAttribs
['rc_patrolled'] ) {
568 PatrolLog
::record( $rc, true, $rc->getPerformer() );
576 * Makes an entry in the database corresponding to page creation
577 * Note: the title object must be loaded with the new id using resetArticleID()
579 * @param string $timestamp
580 * @param Title $title
583 * @param string $comment
589 * @return RecentChange
591 public static function notifyNew(
592 $timestamp, &$title, $minor, &$user, $comment, $bot,
593 $ip = '', $size = 0, $newId = 0, $patrol = 0
595 $rc = new RecentChange
;
596 $rc->mTitle
= $title;
597 $rc->mPerformer
= $user;
598 $rc->mAttribs
= array(
599 'rc_timestamp' => $timestamp,
600 'rc_namespace' => $title->getNamespace(),
601 'rc_title' => $title->getDBkey(),
603 'rc_source' => self
::SRC_NEW
,
604 'rc_minor' => $minor ?
1 : 0,
605 'rc_cur_id' => $title->getArticleID(),
606 'rc_user' => $user->getId(),
607 'rc_user_text' => $user->getName(),
608 'rc_comment' => $comment,
609 'rc_this_oldid' => $newId,
610 'rc_last_oldid' => 0,
611 'rc_bot' => $bot ?
1 : 0,
612 'rc_ip' => self
::checkIPAddress( $ip ),
613 'rc_patrolled' => intval( $patrol ),
614 'rc_new' => 1, # obsolete
616 'rc_new_len' => $size,
619 'rc_log_type' => null,
620 'rc_log_action' => '',
625 'prefixedDBkey' => $title->getPrefixedDBkey(),
626 'lastTimestamp' => 0,
629 'pageStatus' => 'created'
632 DeferredUpdates
::addCallableUpdate( function() use ( $rc ) {
634 if ( $rc->mAttribs
['rc_patrolled'] ) {
635 PatrolLog
::record( $rc, true, $rc->getPerformer() );
643 * @param string $timestamp
644 * @param Title $title
646 * @param string $actionComment
648 * @param string $type
649 * @param string $action
650 * @param Title $target
651 * @param string $logComment
652 * @param string $params
654 * @param string $actionCommentIRC
657 public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip, $type,
658 $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = ''
660 global $wgLogRestrictions;
662 # Don't add private logs to RC!
663 if ( isset( $wgLogRestrictions[$type] ) && $wgLogRestrictions[$type] != '*' ) {
666 $rc = self
::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action,
667 $target, $logComment, $params, $newId, $actionCommentIRC );
674 * @param string $timestamp
675 * @param Title $title
677 * @param string $actionComment
679 * @param string $type
680 * @param string $action
681 * @param Title $target
682 * @param string $logComment
683 * @param string $params
685 * @param string $actionCommentIRC
686 * @return RecentChange
688 public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip,
689 $type, $action, $target, $logComment, $params, $newId = 0, $actionCommentIRC = '' ) {
692 # # Get pageStatus for email notification
693 switch ( $type . '-' . $action ) {
694 case 'delete-delete':
695 $pageStatus = 'deleted';
698 case 'move-move_redir':
699 $pageStatus = 'moved';
701 case 'delete-restore':
702 $pageStatus = 'restored';
704 case 'upload-upload':
705 $pageStatus = 'created';
707 case 'upload-overwrite':
709 $pageStatus = 'changed';
713 $rc = new RecentChange
;
714 $rc->mTitle
= $target;
715 $rc->mPerformer
= $user;
716 $rc->mAttribs
= array(
717 'rc_timestamp' => $timestamp,
718 'rc_namespace' => $target->getNamespace(),
719 'rc_title' => $target->getDBkey(),
721 'rc_source' => self
::SRC_LOG
,
723 'rc_cur_id' => $target->getArticleID(),
724 'rc_user' => $user->getId(),
725 'rc_user_text' => $user->getName(),
726 'rc_comment' => $logComment,
727 'rc_this_oldid' => 0,
728 'rc_last_oldid' => 0,
729 'rc_bot' => $user->isAllowed( 'bot' ) ?
$wgRequest->getBool( 'bot', true ) : 0,
730 'rc_ip' => self
::checkIPAddress( $ip ),
732 'rc_new' => 0, # obsolete
733 'rc_old_len' => null,
734 'rc_new_len' => null,
736 'rc_logid' => $newId,
737 'rc_log_type' => $type,
738 'rc_log_action' => $action,
739 'rc_params' => $params
743 'prefixedDBkey' => $title->getPrefixedDBkey(),
744 'lastTimestamp' => 0,
745 'actionComment' => $actionComment, // the comment appended to the action, passed from LogPage
746 'pageStatus' => $pageStatus,
747 'actionCommentIRC' => $actionCommentIRC
754 * Constructs a RecentChange object for the given categorization
755 * This does not call save() on the object and thus does not write to the db
759 * @param string $timestamp Timestamp of the recent change to occur
760 * @param Title $categoryTitle Title of the category a page is being added to or removed from
761 * @param User $user User object of the user that made the change
762 * @param string $comment Change summary
763 * @param Title $pageTitle Title of the page that is being added or removed
764 * @param int $oldRevId Parent revision ID of this change
765 * @param int $newRevId Revision ID of this change
766 * @param string $lastTimestamp Parent revision timestamp of this change
767 * @param bool $bot true, if the change was made by a bot
768 * @param string $ip IP address of the user, if the change was made anonymously
769 * @param int $deleted Indicates whether the change has been deleted
771 * @return RecentChange
773 public static function newForCategorization(
775 Title
$categoryTitle,
787 $rc = new RecentChange
;
788 $rc->mTitle
= $categoryTitle;
789 $rc->mPerformer
= $user;
790 $rc->mAttribs
= array(
791 'rc_timestamp' => $timestamp,
792 'rc_namespace' => $categoryTitle->getNamespace(),
793 'rc_title' => $categoryTitle->getDBkey(),
794 'rc_type' => RC_CATEGORIZE
,
795 'rc_source' => self
::SRC_CATEGORIZE
,
797 'rc_cur_id' => $pageTitle->getArticleID(),
798 'rc_user' => $user ?
$user->getId() : 0,
799 'rc_user_text' => $user ?
$user->getName() : '',
800 'rc_comment' => $comment,
801 'rc_this_oldid' => $newRevId,
802 'rc_last_oldid' => $oldRevId,
803 'rc_bot' => $bot ?
1 : 0,
804 'rc_ip' => self
::checkIPAddress( $ip ),
805 'rc_patrolled' => 1, // Always patrolled, just like log entries
806 'rc_new' => 0, # obsolete
809 'rc_deleted' => $deleted,
811 'rc_log_type' => null,
812 'rc_log_action' => '',
817 'prefixedDBkey' => $categoryTitle->getPrefixedDBkey(),
818 'lastTimestamp' => $lastTimestamp,
821 'pageStatus' => 'changed'
828 * Initialises the members of this object from a mysql row object
832 public function loadFromRow( $row ) {
833 $this->mAttribs
= get_object_vars( $row );
834 $this->mAttribs
['rc_timestamp'] = wfTimestamp( TS_MW
, $this->mAttribs
['rc_timestamp'] );
835 $this->mAttribs
['rc_deleted'] = $row->rc_deleted
; // MUST be set
839 * Get an attribute value
841 * @param string $name Attribute name
844 public function getAttribute( $name ) {
845 return isset( $this->mAttribs
[$name] ) ?
$this->mAttribs
[$name] : null;
851 public function getAttributes() {
852 return $this->mAttribs
;
856 * Gets the end part of the diff URL associated with this object
857 * Blank if no diff link should be displayed
858 * @param bool $forceCur
861 public function diffLinkTrail( $forceCur ) {
862 if ( $this->mAttribs
['rc_type'] == RC_EDIT
) {
863 $trail = "curid=" . (int)( $this->mAttribs
['rc_cur_id'] ) .
864 "&oldid=" . (int)( $this->mAttribs
['rc_last_oldid'] );
868 $trail .= '&diff=' . (int)( $this->mAttribs
['rc_this_oldid'] );
878 * Returns the change size (HTML).
879 * The lengths can be given optionally.
884 public function getCharacterDifference( $old = 0, $new = 0 ) {
886 $old = $this->mAttribs
['rc_old_len'];
889 $new = $this->mAttribs
['rc_new_len'];
891 if ( $old === null ||
$new === null ) {
895 return ChangesList
::showCharacterDifference( $old, $new );
898 private static function checkIPAddress( $ip ) {
901 if ( !IP
::isIPAddress( $ip ) ) {
902 throw new MWException( "Attempt to write \"" . $ip .
903 "\" as an IP address into recent changes" );
906 $ip = $wgRequest->getIP();
916 * Check whether the given timestamp is new enough to have a RC row with a given tolerance
917 * as the recentchanges table might not be cleared out regularly (so older entries might exist)
918 * or rows which will be deleted soon shouldn't be included.
920 * @param mixed $timestamp MWTimestamp compatible timestamp
921 * @param int $tolerance Tolerance in seconds
924 public static function isInRCLifespan( $timestamp, $tolerance = 0 ) {
927 return wfTimestamp( TS_UNIX
, $timestamp ) > time() - $tolerance - $wgRCMaxAge;
931 * Parses and returns the rc_params attribute
937 public function parseParams() {
938 $rcParams = $this->getAttribute( 'rc_params' );
940 MediaWiki\
suppressWarnings();
941 $unserializedParams = unserialize( $rcParams );
942 MediaWiki\restoreWarnings
();
944 return $unserializedParams;